import 'dart:core';

import '../base/BaseBean.dart';


// class HomeContentBean {
//   List<BannerInfoBean>? advertiseList; //banner集合数据
//   List<GoodsInfoBean>? hotProductList; //热销商品集合
//   List<GoodsInfoBean>? newProductList; //新品推荐集合
//   List<GoodsInfoBean>? liveHomePagesList; //好料直播
//   List<StoreInfoBean>? frequentlyViewList; //关注-常访问的数据
//   List<RecommendListBean>? boutiqueList;
//   List<FollowListBean>? otherAttentionList;
// }

//首页 广告和热销商品集合  新品推荐集合
class HomeContentBean implements  BaseJsonBean{
  List<AdvertiseList>? advertiseList;
  List<NewProductList>? newProductList;
  List<HotProductList>? hotProductList;

  // List<GoodsInfoBean>? liveHomePagesList; //好料直播
  // List<StoreInfoBean>? frequentlyViewList; //关注-常访问的数据
  // List<RecommendListBean>? boutiqueList;
  // List<FollowListBean>? otherAttentionList;

  HomeContentBean({this.advertiseList, this.newProductList, this.hotProductList});

  HomeContentBean.fromJson(Map<String, dynamic> json) {
    if (json['advertiseList'] != null) {
      advertiseList = <AdvertiseList>[];
      json['advertiseList'].forEach((v) {
        advertiseList!.add(new AdvertiseList.fromJson(v));
      });
    }
    if (json['newProductList'] != null) {
      newProductList = <NewProductList>[];
      json['newProductList'].forEach((v) {
        newProductList!.add(new NewProductList.fromJson(v));
      });
    }
    if (json['hotProductList'] != null) {
      hotProductList = <HotProductList>[];
      json['hotProductList'].forEach((v) {
        hotProductList!.add(new HotProductList.fromJson(v));
      });
    }
  }

  Map<String, dynamic> toJson() {
    final Map<String, dynamic> data = new Map<String, dynamic>();
    if (this.advertiseList != null) {
      data['advertiseList'] =
          this.advertiseList!.map((v) => v.toJson()).toList();
    }
    if (this.newProductList != null) {
      data['newProductList'] =
          this.newProductList!.map((v) => v.toJson()).toList();
    }
    if (this.hotProductList != null) {
      data['hotProductList'] =
          this.hotProductList!.map((v) => v.toJson()).toList();
    }
    return data;
  }
}

class AdvertiseList {
  int? id;
  String? name;
  String? type;
  String? pic;
  String? startTime;
  String? endTime;
  int? status;
  int? clickCount;
  int? orderCount;
  String? url;
  String? note;
  int? sort;
  String? color;
  int? advertiseType;
  String? productId;
  String? storeId;

  AdvertiseList(
      {this.id,
        this.name,
        this.type,
        this.pic,
        this.startTime,
        this.endTime,
        this.status,
        this.clickCount,
        this.orderCount,
        this.url,
        this.note,
        this.sort,
        this.color,
        this.advertiseType,
        this.productId,
        this.storeId});

  AdvertiseList.fromJson(Map<String, dynamic> json) {
    id = json['id'];
    name = json['name'];
    type = json['type'];
    pic = json['pic'];
    startTime = json['startTime'];
    endTime = json['endTime'];
    status = json['status'];
    clickCount = json['clickCount'];
    orderCount = json['orderCount'];
    url = json['url'];
    note = json['note'];
    sort = json['sort'];
    color = json['color'];
    advertiseType = json['advertiseType'];
    productId = json['productId'];
    storeId = json['storeId'];
  }

  Map<String, dynamic> toJson() {
    final Map<String, dynamic> data = new Map<String, dynamic>();
    data['id'] = this.id;
    data['name'] = this.name;
    data['type'] = this.type;
    data['pic'] = this.pic;
    data['startTime'] = this.startTime;
    data['endTime'] = this.endTime;
    data['status'] = this.status;
    data['clickCount'] = this.clickCount;
    data['orderCount'] = this.orderCount;
    data['url'] = this.url;
    data['note'] = this.note;
    data['sort'] = this.sort;
    data['color'] = this.color;
    data['advertiseType'] = this.advertiseType;
    data['productId'] = this.productId;
    data['storeId'] = this.storeId;
    return data;
  }
}

class NewProductList {
  int? rank;
  String? productId;
  String? name;
  String? pic;
  int? sale;
  double? price;
  int? newStatus;
  String? firstDate;
  int? isAskPriceFlag;

  NewProductList(
      {this.rank,
        this.productId,
        this.name,
        this.pic,
        this.sale,
        this.price,
        this.newStatus,
        this.firstDate,
        this.isAskPriceFlag});

  NewProductList.fromJson(Map<String, dynamic> json) {
    rank = json['rank'];
    productId = json['productId'];
    name = json['name'];
    pic = json['pic'];
    sale = json['sale'];
    price = json['price'];
    newStatus = json['newStatus'];
    firstDate = json['firstDate'];
    isAskPriceFlag = json['isAskPriceFlag'];
  }

  Map<String, dynamic> toJson() {
    final Map<String, dynamic> data = new Map<String, dynamic>();
    data['rank'] = this.rank;
    data['productId'] = this.productId;
    data['name'] = this.name;
    data['pic'] = this.pic;
    data['sale'] = this.sale;
    data['price'] = this.price;
    data['newStatus'] = this.newStatus;
    data['firstDate'] = this.firstDate;
    data['isAskPriceFlag'] = this.isAskPriceFlag;
    return data;
  }
}

class HotProductList {
  int? rank;
  String? productId;
  String? name;
  String? pic;
  int? sale;
  String? saleStr;
  double? price;
  int? newStatus;
  int? accumulated;
  String? accumulatedStr;
  int? productType;
  int? isAskPriceFlag;
  String? askPrice;

  HotProductList(
      {this.rank,
        this.productId,
        this.name,
        this.pic,
        this.sale,
        this.saleStr,
        this.price,
        this.newStatus,
        this.accumulated,
        this.accumulatedStr,
        this.productType,
        this.isAskPriceFlag,
        this.askPrice});

  HotProductList.fromJson(Map<String, dynamic> json) {
    rank = json['rank'];
    productId = json['productId'];
    name = json['name'];
    pic = json['pic'];
    sale = json['sale'];
    saleStr = json['saleStr'];
    price = json['price'];
    newStatus = json['newStatus'];
    accumulated = json['accumulated'];
    accumulatedStr = json['accumulatedStr'];
    productType = json['productType'];
    isAskPriceFlag = json['isAskPriceFlag'];
    askPrice = json['askPrice'];
  }

  Map<String, dynamic> toJson() {
    final Map<String, dynamic> data = new Map<String, dynamic>();
    data['rank'] = this.rank;
    data['productId'] = this.productId;
    data['name'] = this.name;
    data['pic'] = this.pic;
    data['sale'] = this.sale;
    data['saleStr'] = this.saleStr;
    data['price'] = this.price;
    data['newStatus'] = this.newStatus;
    data['accumulated'] = this.accumulated;
    data['accumulatedStr'] = this.accumulatedStr;
    data['productType'] = this.productType;
    data['isAskPriceFlag'] = this.isAskPriceFlag;
    data['askPrice'] = this.askPrice;
    return data;
  }
}